package com.huang.auth.converter;

import com.huang.auth.entity.po.CommonLoginLogPO;
import com.huang.auth.entity.vo.LoginLogsVO;
import com.huang.base.core.BaseConvertor;
import org.springframework.stereotype.Component;

/**
 * @Author HuangShen
 * @Date 2022/1/27 20:40
 * @Describe 登陆日志VO 转换
 */
@Component
public class LoginLogsVOConverter extends BaseConvertor<CommonLoginLogPO, LoginLogsVO> {
    @Override
    public LoginLogsVO doConvert(CommonLoginLogPO m) {
        LoginLogsVO loginLogsVO = new LoginLogsVO();
        loginLogsVO.setLoginDate(m.getLoginDate());
        loginLogsVO.setLocation(m.getLocation());
        loginLogsVO.setDescription(m.getDescription());
        loginLogsVO.setId(String.valueOf(m.getId()));
        loginLogsVO.setOperatingSystem(m.getOperatingSystem());
        loginLogsVO.setRequestIp(m.getRequestIp());
        return loginLogsVO;
    }
}
